package com.yzt.zhuju.arouter;

import androidx.fragment.app.Fragment;

import com.alibaba.android.arouter.launcher.ARouter;
import com.yzt.zhuju.network.entity.dynamic.DynamicListBean;

import java.util.ArrayList;
import java.util.List;

/**
 * author : bob
 * date   : 2023/2/27
 * desc   : 动态路由
 */
public class RouterDynamic {

    public static final String FRAGMENT_GAME_LIST = "/game/GameListFragment";

    public static final String FRAGMENT_DYNAMIC_DETAIL = "/game/DynamicDetailActivity";

    public static final String ACTIVITY_GAME_ADD = "/dynamic/GameAddActivity";

    public static final String ACTIVITY_DYNAMIC_ADD = "/dynamic/AddDynamicActivity";

    public static final String ACTIVITY_DYNAMIC_TEXT_ADD = "/dynamic/AddTextDynamicActivity";

    public static final String ACTIVITY_GAME_DETAIL = "/game/GameDetailActivity";

    public static final String ACTIVITY_GAME_CAMERA = "/game/CameraEditActivity";

    public static final String PATH_DYNAMIC_VIDEO_SCROLLER = "/dynamic/DynamicVideoScrollerPageActivity";


    public static Fragment GameListFragment() {
        return (Fragment) ARouter.getInstance().build(FRAGMENT_GAME_LIST).navigation();
    }

    public static void DynamicDetailActivity(DynamicListBean detail) {
        ARouter.getInstance().build(FRAGMENT_DYNAMIC_DETAIL).withSerializable("detail", detail).navigation();
    }

    public static void GameDetailActivity(String gameId) {
        ARouter.getInstance().build(ACTIVITY_GAME_DETAIL).withString("gameId", gameId).navigation();
    }

    public static void DynamicVideoScrollerPageActivity(String userId, String commentId) {
        ARouter.getInstance().build(PATH_DYNAMIC_VIDEO_SCROLLER).withString("userId", userId).withString("dynamicId", commentId).navigation();
    }

    public static void GameAddActivity() {
        ARouter.getInstance().build(ACTIVITY_GAME_ADD).navigation();
    }

    public static void CameraEditActivity() {
        ARouter.getInstance().build(ACTIVITY_GAME_CAMERA).navigation();
    }

    public static void AddDynamicActivity(String path, int type) {
        ARouter.getInstance().build(ACTIVITY_DYNAMIC_ADD).withString("extra_path", path)
                .withInt("extra_type", type).navigation();
    }

    public static void AddDynamicActivity(String path, ArrayList<String> listPath, int type) {
        ARouter.getInstance().build(ACTIVITY_DYNAMIC_ADD).withString("extra_path", path).withStringArrayList("extra_list_path", listPath)
                .withInt("extra_type", type).navigation();
    }


    public static void AddDynamicTextActivity() {
        ARouter.getInstance().build(ACTIVITY_DYNAMIC_TEXT_ADD).navigation();
    }
}
